<template>
  <el-dialog v-model="visible" title="协商任务" width="90%">
    <el-form ref="formRef" :model="formData" :rules="formRules" label-width="120px">
      <el-divider content-position="left">基本信息</el-divider>
      <el-row>
        <el-col :span="6">
          <el-form-item label="合作编号">
            <el-input v-model="formData.indexId" placeholder="请输入合作编号" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="客户姓名">
            <el-input v-model="formData.customName" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="性别">
            <el-input v-model="formData.sex" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="托管类型">
            <el-input v-model="formData.trusteeshipType" disabled></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-divider content-position="left">任务信息</el-divider>
      <el-row>
        <el-col :span="6">
          <el-form-item label="任务状态" prop="taskStatus">
            <el-select v-model="formData.taskStatus">
              <el-option v-for="item in getEnumBySn('taskStatus')" :key="item.value"
                         :label="item.label" :value="item.value"/>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="任务类型" prop="taskType">
            <el-select v-model="formData.taskType">
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="处理人" prop="handleUserNo">
            <el-select v-model="formData.handleUserNo"></el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="任务描述">
            <el-input v-model="formData.handleUserNo"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-divider content-position="left">协商信息</el-divider>
    </el-form>
  </el-dialog>
</template>

<script lang="ts" setup>

import {getEnumBySn} from "@/api/enums";

const visible = ref(false)
const formRef = ref()
const formData = ref()

const formRules = ref({
  taskStatus: [{required: true, message: '请选择任务状态', trigger: ['change']}],
  taskType: [{required: true, message: '请选择任务类型', trigger: ['change']}],
  handleUserNo: [{required: true, message: '请选择处理人', trigger: ['change']}],
})

defineExpose({
  open: (orderData) => {
    console.log('----订单信息为-----', orderData)
    visible.value = true
    formData.value = {...orderData}
  }
})
</script>

<style lang="scss" scoped>

</style>
